Fix a few problems with custom color replacement
authorMatthias Clasen <mclasen@redhat.com>
Wed, 1 Feb 2012 07:00:21 +0000 (02:00 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 14 Feb 2012 21:36:52 +0000 (16:36 -0500)
We were allowing one too many custom colors in, and when one
of them was dropped, we did not update the shape of the penultimate
one.

gtk/gtkcolorchooserwidget.c

index 04ac168db035558237bf0a339cf71ee2cf941acc..7888d10bac5ede62853c5e5f03ae58046bbf5a2b 100644 (file)
@@ -483,9 +483,13 @@ add_custom_color (GtkColorChooserWidget *cc,
   GtkWidget *last;
   GtkWidget *p;
 
-  last = gtk_grid_get_child_at (GTK_GRID (cc->priv->custom), 9, 0);
+  last = gtk_grid_get_child_at (GTK_GRID (cc->priv->custom), 8, 0);
   if (last)
-    gtk_container_remove (GTK_CONTAINER (cc->priv->custom), last);
+    {
+      gtk_container_remove (GTK_CONTAINER (cc->priv->custom), last);
+      last = gtk_grid_get_child_at (GTK_GRID (cc->priv->custom), 7, 0);
+      gtk_color_swatch_set_corner_radii (GTK_COLOR_SWATCH (last), 1, 10, 10, 1);
+    }
 
   gtk_color_swatch_set_corner_radii (GTK_COLOR_SWATCH (cc->priv->button), 10, 1, 1, 10);